package com.hj.saapp.control.activity;


import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.EditText;


import com.hj.saapp.R;
import com.hj.saapp.control.activity.base.BaseActivity;
import com.hj.saapp.view.BaseView;


public class JieRuQu extends BaseActivity implements View.OnClickListener {
    private WebView webView;
    private EditText editText;
    private Button search;



    @Override
    public int getLayoutByid() {
        return R.layout.activity_jie_ru_qu;
    }

    @Override
    public int getTitleById() {
        return R.string.jie_ru_qu;
    }

    @Override
    public void initView() {
        webView = (WebView) findViewById(R.id.webView);
        editText = (EditText) findViewById(R.id.iurl);
        search = (Button) findViewById(R.id.search);
        search.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        String url = editText.getText().toString();
        webView.loadUrl(url);
        webView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                webView.loadUrl(url);
                return true;
            }
        });

    }
}
